package com.seatch.msuser.config;

import org.springframework.context.annotation.Bean;

import java.util.Properties;

public class NacosConfigStarter {

    @Bean
    public Properties globalNacosProperties() {
        Properties properties = new Properties();
        //properties.setProperty("serverAddr",System.getProperty("serverAddr"));//从环境变量获取后放入Properties
        properties.setProperty("serverAddr","localhost:9999");
        properties.setProperty("username","nacos");
        properties.setProperty("namespace","ns-dev");
        properties.setProperty("password","nacos");

        return properties;
    }

//    public static void main(String[] args) {
//        //设置环境变量
//        System.setProperty("nacos.config.serverAddr","localhost:8848");
//        System.setProperty("nacos.config.username","nacos");
//        System.setProperty("nacos.config.namespace","ns-dev");
//        System.setProperty("nacos.config.password","nacos");
//
//        SpringApplication.run(DemoApplication.class,args);
//        System.out.println("启动成功");
//    }


}
